<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>添加健康指标</title>
    <style>
        .form-container {
            max-width: 500px;
            margin: 20px auto;
            padding: 20px;
            border: 1px solid #ddd;
            border-radius: 5px;
            box-shadow: 0 2px 4px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 15px;
        }
        label {
            display: block;
            margin-bottom: 5px;
            font-weight: bold;
            color: #333;
        }
        input, select {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 4px;
            box-sizing: border-box;
        }
        .btn {
            background-color: #4CAF50;
            color: white;
            padding: 10px 15px;
            border: none;
            border-radius: 4px;
            cursor: pointer;
            font-size: 16px;
            width: 100%;
        }
        .btn:hover {
            background-color: #45a049;
        }
        h2 {
            text-align: center;
            color: #333;
        }
    </style>
</head>
<body>
<div class="form-container">
    <h2>添加健康指标记录</h2>
    <form action="<%=request.getContextPath()%>/healthmetrics/add" method="post">
        <div class="form-group">
            <label for="userid">用户ID</label>
            <input type="number" id="userid" name="userid" required>
        </div>

        <div class="form-group">
            <label for="metricstype">指标类型</label>
            <select id="metricstype" name="metricstype" required>
                <option value="weight">体重</option>
                <option value="bloodpressure">血压</option>
                <option value="heartrate">心率</option>
            </select>
        </div>

        <div class="form-group">
            <label for="value">指标数值</label>
            <input type="text" id="value" name="value" required>
        </div>

        <div class="form-group">
            <label for="unit">单位</label>
            <input type="text" id="unit" name="unit" required>
        </div>

        <div class="form-group">
            <label for="createtime">记录日期</label>
            <input type="date" id="createtime" name="createtime" required>
        </div>

        <button type="submit" class="btn">保存记录</button>
    </form>
</div>
</body>
</html>